#ifndef __AS_LOG__H__
#define __AS_LOG__H__

#include "..\base\ASDataType.h"


#ifdef AS_LOG_ENABLE
void as_log_init(void);
void as_log_deinit(void);
ASINT as_log_locate(char* file_name, ASUINT file_line);
void _as_log(char* cmd, ...);
void _as_log_binary(ASCHAR* content, ASINT len);
void _as_log_str(ASCHAR* content);
#if 1//def WIN32
#define as_log          if(as_log_locate(__FILE__, __LINE__))_as_log
#define as_log_binary   if(as_log_locate(__FILE__, __LINE__))_as_log_binary
#define as_log_str      if(as_log_locate(__FILE__, __LINE__))_as_log_str
#else
#define as_log(...)		if(as_log_locate(__FILE__, __LINE__)) _as_log(__VA_ARGS__)
#define as_log_binary(content,len)		if(as_log_locate(__FILE__, __LINE__)) _as_log_binary(content,len)
#define as_log_str(content)      if(as_log_locate(__FILE__, __LINE__))_as_log_str(content)
#endif

#ifdef AS_LOG_FATAL_ENABLE
#define as_log_fatal as_log
#else
#define as_log_fatal
#endif

#ifdef AS_LOG_ADV_ENABLE
#define as_log_adv as_log
#else
#define as_log_adv
#endif

#ifdef AS_LOG_APE_ENABLE
#define as_log_ape as_log
#else
#define as_log_ape
#endif

#ifdef AS_LOG_MEM_ENABLE
#define as_log_mem as_log
#else
#define as_log_mem
#endif

#ifdef AS_LOG_IMGRES_ENABLE
#define as_log_imgres as_log
#else
#define as_log_imgres
#endif

#ifdef AS_LOG_APP_ENABLE
#define as_log_app as_log
#else
#define as_log_app
#endif

#ifdef AS_LOG_UI_ENABLE
#define as_log_ui as_log
#else
#define as_log_ui
#endif

#ifdef AS_LOG_CTRL_ENABLE
#define as_log_ctrl as_log
#else
#define as_log_ctrl
#endif

#ifdef AS_LOG_FREEPAY_ENABLE
#define as_log_fp as_log
#else
#define as_log_fp
#endif

#else//AS_LOG_ENABLE
#define as_log_init()
#define as_log_deinit()
#define as_log(...)
#define _as_log_binary
#define as_log_str
#define as_log_ape
#define as_log_adv
#define as_log_mem
#define as_log_fatal
#define as_log_imgres
#define as_log_app
#define as_log_ui
#define as_log_ctrl
#define as_log_fp

#endif//AS_LOG_ENABLE

#if defined(AS_RUN_ON_MRE)
#elif defined(AS_RUN_ON_SKY)
#define as_printf       mrc_printf
#endif

//ASVOID as_snapshot_layer_to_bmp(ASINT layer, ASWCHAR* file_path);


#endif//__AS_LOG__H__